<?php
/**
 * @version		$Id: query.php 2011.08.11 thierry $
 * @package		admin.models
 * @subpackage	com_projid
 * @copyright	Copyright (C) 2011 Pojid All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */
//Model duy server
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the Joomla modellist library
jimport('joomla.application.component.modeladmin');
/**
 * Projid Model
 */
class ProjidModelQuery extends JModelAdmin
{

	public function getTable($type = 'Query', $prefix = 'ProjidTable', $config = array()) 
	{
		return JTable::getInstance($type, $prefix, $config);
	}

	public function getForm($data = array(), $loadData = true) 
	{
		// Get the form.
		$form = $this->loadForm('com_projid.query', 'query', array('control' => 'jform', 'load_data' => $loadData));
		if (empty($form)) 
		{
			return false;
		}
		return $form;
	}

	protected function loadFormData() 
	{
		// Check the session for previously entered form data.
		$data = JFactory::getApplication()->getUserState('com_projid.edit.query.data', array());
		if (empty($data)) 
		{
			$data = $this->getItem();
		}
		return $data;
	}
}
